package com.horay.springbootdemo.caffeine.redis;

import com.horay.springbootdemo.caffeine.redis.userinfo.service.UserInfoService;
import com.horay.springbootdemo.kit.cache.CacheKitApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Import;

/**
 * 缓存服务启动类
 *
 * @author heyingcheng
 * @date 2019/7/22 17:22
 */
@EnableCaching
@Import({CacheKitApplication.class})
@SpringBootApplication
public class CaffeineRedisApplication implements CommandLineRunner {

    @Autowired
    private UserInfoService userInfoService;

	public static void main(String[] args) {
		SpringApplication.run(CaffeineRedisApplication.class, args);
	}

    @Override
    public void run(String... args) throws Exception {
        userInfoService.cacheUser();
    }

}
